package com.xiaoman.jvm;

import com.xiaoman.jvm.command.Command;

public class jvm {
    public static void main(String[] args) {
        Command cmd = Command.parse(args);
        if (!cmd.isOk() || cmd.isHelpFlag()) {
            System.out.println("Usage: <main class> [-options] class [args...]");
            return;
        }
        if (cmd.isVersionFlag()) {
            System.out.println("java version \"1.8.0\"");
            return;
        }
        startJVM(cmd);
    }

    private static void startJVM(Command cmd) {
        System.out.printf("classpath:%s class:%s args:%s\n", cmd.getClasspath(), cmd.getMainClass(), cmd.getAppArgs());
    }

}
